<form name="pwdForm" class="system-form-cont" novalidate>
    <div class="modal-header">
        <h4 class="modal-title">修改密码</h4>
    </div>
    <div class="modal-body">
        <div class="form-group height-60">
            <label for="oldPassword">原密码</label>
            <input type="password" class="form-control" name="oldPassword" ng-model="vm.data.oldPassword" id="oldPassword" ng-blur="vm.checkValid(pwdForm.oldPassword)" required placeholder="原密码" ng-class="{error: pwdForm.oldPassword.$invalid && !pwdForm.oldPassword.$pristine}"/>
            <span class="error" ng-show="pwdForm.oldPassword.$invalid && !pwdForm.oldPassword.$pristine">原密码不能为空</span>
            <span class="error" ng-show="pwdForm.oldPassword.$modelValue.length < 6">原密码少于6位</span>
        </div>
        <div class="form-group height-60">
            <label for="newPassword">新密码</label>
            <input type="password" class="form-control" name="newPassword" ng-model="vm.data.newPassword" id="newPassword"  ng-blur="vm.checkValid(pwdForm.newPassword)" required placeholder="新密码" ng-class="{error: (pwdForm.newPassword.$invalid && !pwdForm.newPassword.$pristine) || ((pwdForm.newPassword.$modelValue.length < 6) && !pwdForm.newPassword.$pristine)}"/>
            <span class="error" ng-show="pwdForm.newPassword.$invalid && !pwdForm.newPassword.$pristine">新密码不能为空</span>
            <span class="error" ng-show="(pwdForm.newPassword.$modelValue.length < 6) && (pwdForm.newPassword.$modelValue !== pwdForm.oldPassword.$modelValue) && !pwdForm.newPassword.$pristine">密码最少6位</span>
            <span class="error" ng-show="pwdForm.oldPassword.$valid && (pwdForm.newPassword.$modelValue == pwdForm.oldPassword.$modelValue) && !pwdForm.newPassword.$pristine">新密码不能与原密码相同</span>
        </div>
        <div class="form-group height-60">
            <label for="confirmPassword">确认密码</label>
            <input type="password" class="form-control" name="confirmPassword" ng-model="vm.data.confirmPassword" id="confirmPassword" ng-blur="vm.checkValid(pwdForm.confirmPassword)" required placeholder="确认新密码" ng-class="{error: (pwdForm.confirmPassword.$invalid && !pwdForm.confirmPassword.$pristine)||(pwdForm.confirmPassword.$valid && (pwdForm.newPassword.$modelValue !== pwdForm.confirmPassword.$modelValue) && !pwdForm.confirmPassword.$pristine)}" />
            <span class="error" ng-show="pwdForm.confirmPassword.$invalid && !pwdForm.confirmPassword.$pristine">确认密码不能为空</span>
            <span class="error" ng-show="pwdForm.confirmPassword.$valid && (pwdForm.newPassword.$modelValue !== pwdForm.confirmPassword.$modelValue) && !pwdForm.confirmPassword.$pristine">两次输入的密码不同</span>
        </div>
    </div>
    <div class="modal-footer">
        <button type="button" ng-click="vm.save()" class="btn btn-primary" ng-disabled="pwdForm.$invalid || (pwdForm.newPassword.$modelValue.length < 6) || (pwdForm.newPassword.$modelValue !== pwdForm.confirmPassword.$modelValue)"><span ng-show="vm.submitting"><i class="fa fa-spinner fa-spin"></i></span>保存</button>
        <button ng-click="vm.cancel()" type="button" class="btn btn-default cancel">取消</button>
    </div>
</form>